'use strict';

const Service=require('egg').Service;

class BillService extends Service{
    async list (id){
        const {ctx,app}=this;
        const QUERTY_STR=`id,pay_type,amount,date,type_id,type_name,remark`;
        let sql=`select ${QUERTY_STR} from bill where user_id=${id}`;
        try {
            const result=await app.mysql.query(sql);
            // console.log(result);
            return result;
        } catch (error) {
            console.log(error);
            return null;
        }
    }
}

module.exports=BillService;